Repository navigation
Deallocate the GPU pool's idle node so later runs find the PyTorch image - #54
Merged
Merged
Conversation
The note under "How to run it" said that the job's pod waits for its image the first time you run the tutorial, but it waits on every run. Each node the cluster autoscaler adds to the GPU pool is a new k3d container with an image store of its own, and the emulator's autoscaler removes a node, and its images with it, once the node has been idle for 30 seconds, so no run finds the image already downloaded. On a later run on LocalStack for Azure, the kubelet again logged "Successfully pulled image ... in 5m12.656s". The note now says that every run waits and why, and that 06-simulate-eviction.sh waits twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FvNuJKW5UZQ1Rce8qnG2GR
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The tutorial overstates image-download requirements for reruns and should qualify those claims to account for cached-image reuse when no fresh GPU node is needed.
1 open issue
What changed in this PR
This documentation-only PR updates the GPU node pools tutorial to explain recurring PyTorch image download delays as GPU nodes are removed and recreated.
Changes:
- Replaces the first-run warning with recurring download expectations for training and eviction scripts.
- Explains node-local image caching and the different idle scale-down delays in LocalStack and AKS.
| File | Description |
|---|---|
tutorials/gpu-node-pools/README.md |
Expands the startup-delay note with image lifecycle and script-specific download expectations. |
Review effort: Balanced
Each run of a training job waited 5 to 6 minutes for its GPU node to pull pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime, because the cluster autoscaler deleted the idle node, and the image with it, once the job was done. 01-add-gpu-node-pool.sh now adds the GPU pool with --scale-down-mode Deallocate and --node-osdisk-type Managed: the autoscaler deallocates the idle node instead, its OS disk keeps the image, and it starts that node again, before it adds any new node, for the next job (Microsoft Learn, aks/scale-down-mode, which supports Spot pools since its general availability and requires a managed OS disk). A pool that already exists gets the scale-down mode with az aks nodepool update; its OS disk type can't change, so a pool with another one stops the script, as one with another VM size or priority already did. The eviction in 06-simulate-eviction.sh still deletes its node, under the pool's Delete eviction policy, so the node that replaces it pulls the image again. The README's note, the scripts table and "How it works" say so, and 05 and 06 describe the node a run starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FvNuJKW5UZQ1Rce8qnG2GR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
Every run of the training job in the GPU node pools tutorial waited 5 to 6 minutes before its pod started, though the note under How to run it said that happened only the first time.
The GPU node downloaded
pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime(about 3 GB) again on every run, because the cluster autoscaler deleted the idle node, and the image with it, once the previous job was done.06-simulate-eviction.shwaited twice. For a demo, that is too long.AKS keeps a node's images through a scale-down when the pool's Scale-down Mode is
Deallocate.The cluster autoscaler then deallocates the idle node instead of deleting it, and the node's OS disk keeps the images its pods pulled.
The next time a pod needs the pool, the autoscaler starts the node again, before it adds any new node.
Spot pools have supported it since it became generally available, and it requires a managed OS disk.
Changes
scripts/00-variables.sh: addsGPU_NODE_SCALE_DOWN_MODE="Deallocate"andGPU_NODE_OS_DISK_TYPE="Managed", with a comment on what the mode does and why an eviction still deletes the node.scripts/01-add-gpu-node-pool.sh:--scale-down-modeand--node-osdisk-type.az aks nodepool update --scale-down-mode.osDiskTypeandscaleDownMode.scripts/05-run-training-job.shandscripts/06-simulate-eviction.sh: their comments and messages say that:Delete) applies to it rather than its scale-down mode, so the node that replaces it pulls the image again.README.md:The first commit corrected the note for the emulator as it is today; the second rewrites it for the new behaviour.
Tests
scripts/01-user-assigned-managed-identity.sh:01to04passed. The pool reportsosDiskType: Managed,scaleDownMode: Deallocate,scaleSetPriority: SpotandscaleSetEvictionPolicy: Delete.05-run-training-job.sh: 423 s, of which 5m20.526s were the new node's image pull. 35 s after the job ended, the autoscaler deallocated the node: its container exited, the Node wentNotReadywith the Cloud Controller Manager's shutdown taint, the VMSS instance reportedPowerState/deallocated, and the pool reportedcount: 0.06-simulate-eviction.sh: passed in 657 s. Its pod started on the restarted node 31 s after its creation, withContainer image "pytorch/pytorch:2.5.1-cuda12.4-cudnn9-runtime" already present on machine. The eviction deleted that node, and the replacement pod's new node pulled the image in 5m53.577s.05-run-training-job.sh: 154 s, on the restarted node, with the image already present.localstack/localstack-azure:latest(build2026.11.0.dev770), before this change, a later run's pod spent 5m12.656s pulling the image. Until pull request 10317 ships, the emulator accepts--scale-down-mode Deallocatebut deletes the idle node as before.bash -npasses on the changed scripts.pre-commit run: gitleaks passed, zizmor skipped. The note renders as a Note alert through GitHub's markdown API.Standard_NV18ads_A10_v5pool with--scale-down-mode Deallocate --node-osdisk-type Managed. Microsoft Learn documents both flags, and Scale-down Mode's support for Spot pools.Related
Deallocate. This pull request should merge once that one ships inlocalstack/localstack-azure:latest.🤖 Generated with Claude Code
https://claude.ai/code/session_01FvNuJKW5UZQ1Rce8qnG2GR